package com.gblfy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.util.StopWatch;

/**
 * office吻你你就爱你在线预览
 *
 * @author gblfy
 * @date 2021-10-28
 */
@SpringBootApplication
public class OnlinePreviewApplication {
    private static final Logger logger = LoggerFactory.getLogger(OnlinePreviewApplication.class);

    public static void main(String[] args) {
        StopWatch stopWatch = new StopWatch();
        stopWatch.start();
        ConfigurableApplicationContext context = new SpringApplicationBuilder(OnlinePreviewApplication.class)
                .logStartupInfo(false)
                .run(args);
        Integer port = context.getBean(ServerProperties.class).getPort();
        logger.info("lyFileView 服务启动完成，耗时:{}s，演示页请访问: http://127.0.0.1:{}/doc.html ", stopWatch.getTotalTimeSeconds(), port);
    }

}
